﻿public class ObstacleCounterAtScreen
{
    public int getCountObstacles()
    {        
        ObstacleModel obstacleModel = DAL.Instance.createObstacleModel();
        int result = calculateCountObstaclesFrom(obstacleModel.SizeScreen, obstacleModel.Gap);

        return result;
    }

    private int calculateCountObstaclesFrom(int sizeScreen, float gap)
    {
        int result = 1;

        if (gap <= sizeScreen)
            result = (int)(sizeScreen / gap) + 1;

        return result;
    }
}
